package vn.fsoft.gst.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * The User class provides: entity to mapping user table Hibernate
 * @author TienNM
 *
 */
@Entity
@Table(name = "user")
public class User {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "UserID")
	private int userID;

	@Column(name = "Account")
	private String account;

	@Column(name = "Email")
	private String email;

	@Column(name = "Role", columnDefinition = "char(10)")
	private String role;

	@Column(name = "Password")
	private String password;

	@OneToMany(mappedBy = "user")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<SupportingMaterial> listSupportingMaterials;

	public List<SupportingMaterial> getListSupportingMaterials() {
		return listSupportingMaterials;
	}

	public void setListSupportingMaterials(
			List<SupportingMaterial> listSupportingMaterials) {
		this.listSupportingMaterials = listSupportingMaterials;
	}

	public int getUserID() {
		return userID;
	}

	public void setUserID(int userID) {
		this.userID = userID;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
